<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	
</h:head>

<h:body>
	<ui:composition template="/template/common/commonLayout.xhtml">

		<ui:define name="content">
			<h:outputStylesheet library="css" name="table-style.css" />
			<h:outputStylesheet library="css" name="statistics.css" />
			
			<h1 style="color: #709FB3;">Statistika vikend dežurstev</h1>
			
			<div id="statistics" class="statistics">
				<h:form>
					<p:messages id="messages" />
						<table class="formTable maxWidth">
							<tr class="formRow1">
								<td class="labelCell months">
									<h:outputText value="#{translatorService.translate('statistics.months')}" />
								</td>
								<td class="inputCell months">
									<h:selectOneMenu id="months" styleClass="fieldSelection" value="#{statisticsController.selectedMonth}">
										<f:selectItems
											value="#{outOfWorkController.getDiscreteValueProvider().getDiscreteValueSet('Months')}" />
									</h:selectOneMenu>
								</td>								
								<td class="labelCell years">
									<h:outputText value="#{translatorService.translate('statistics.years')}" />
								</td>
								<td class="inputCell years">
									<h:selectOneMenu id="years" styleClass="fieldSelection" value="#{statisticsController.selectedYear}">
										<f:selectItems
											value="#{statisticsController.getDiscreteValueProvider().getDiscreteValueSet('Years')}" />
									</h:selectOneMenu>
								</td>
								<td class="labelCell empty">
								</td>
								<td class="inputCell empty">
								</td>
							</tr>
						</table>
						<p:spacer width="100%" height="20" />
					
						<p:pieChart id="chart" model="#{statisticsController.pieChartModel}" />
						
						<p:commandButton value="#{translatorService.translate('statistics.button.showStatistic')}"
									actionListener="#{statisticsController.getNewValues()}" 
									update="chart"/>	 
				</h:form>
				
			</div>
			
		</ui:define>
	</ui:composition>
</h:body>

</html>